#pragma once

#include <ScenePrecompiled.hxx>
#include <InternalSceneFbx.hxx>

namespace Eifersucht
{
	//template <typename _TReignContainer>
	//// Swaps y-z values in the Reign containers.
	//inline void _Swap_rh_lh(
	//	_TReignContainer &_This
	//	)
	//{
	//	std::swap(_This.y, _This.z);
	//}
	//template <typename _TReignContainer>
	//// Swaps y-z values in the Reign containers.
	//inline void _Swap_rh_lh(
	//	_TReignContainer *_This
	//	)
	//{
	//	std::swap(_This->y, _This->z);
	//}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 2 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector2( 
		_Inout_ _TReignContainer &_This, 
		_In_ _TFbxContainer const &_Other
		)
	{
		_This.x = _To_float(_Other[0]);
		_This.y = _To_float(_Other[1]);
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 2 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector2( 
		_Inout_ _TReignContainer *_This, 
		_In_ _TFbxContainer const *_Other
		)
	{
		(*_This).x = _To_float((*_Other)[0]);
		(*_This).y = _To_float((*_Other)[1]);
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 2 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector3( 
		_Inout_ _TReignContainer *_This, 
		_In_ _TFbxContainer const *_Other, 
		_In_opt_ Float32 fThisZ = 0.0f 
		)
	{
		(*_This).x = _To_float((*_Other)[0]);
		(*_This).y = _To_float((*_Other)[1]);
		(*_This).z = fThisZ;
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 3 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector3( 
		_Inout_ _TReignContainer &_This, 
		_In_ _TFbxContainer const &_Other 
		)
	{
		_This.x = _To_float(_Other[0]);
		_This.y = _To_float(_Other[1]);
		_This.z = _To_float(_Other[2]);
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 3 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector3( 
		_Inout_ _TReignContainer *_This, 
		_In_ _TFbxContainer const *_Other 
		)
	{
		(*_This).x = _To_float((*_Other)[0]);
		(*_This).y = _To_float((*_Other)[1]);
		(*_This).z = _To_float((*_Other)[2]);
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 4 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector4( 
		_Inout_ _TReignContainer &_This, 
		_In_ _TFbxContainer const &_Other 
		)
	{
		_This.x = _To_float(_Other[0]);
		_This.y = _To_float(_Other[1]);
		_This.z = _To_float(_Other[2]);
		_This.w = _To_float(_Other[3]);
	}

	template <typename _TReignContainer, typename _TFbxContainer>
	// Copies 4 values from the Fbx container to the provided Reign container.
	inline void _Cast_vector4( 
		_Inout_ _TReignContainer *_This, 
		_In_ _TFbxContainer const *_Other 
		)
	{
		(*_This).x = _To_float((*_Other)[0]);
		(*_This).y = _To_float((*_Other)[1]);
		(*_This).z = _To_float((*_Other)[2]);
		(*_This).w = _To_float((*_Other)[3]);
	}

	template <typename _TFbxMatrix>
	// Copies 16 values from the Fbx container to the provided Reign container.
	inline void _Cast_matrix(
		_Inout_ Reign::Matrix &This,
		_In_ _TFbxMatrix const &_Other 
		)
	{
		This._11 = _To_float(_Other[0][0]); This._12 = _To_float(_Other[0][1]); This._13 = _To_float(_Other[0][2]); This._14 = _To_float(_Other[0][3]);
		This._21 = _To_float(_Other[1][0]); This._22 = _To_float(_Other[1][1]); This._23 = _To_float(_Other[1][2]); This._24 = _To_float(_Other[1][3]);
		This._31 = _To_float(_Other[2][0]); This._32 = _To_float(_Other[2][1]); This._33 = _To_float(_Other[2][2]); This._34 = _To_float(_Other[2][3]);
		This._41 = _To_float(_Other[3][0]); This._42 = _To_float(_Other[3][1]); This._43 = _To_float(_Other[3][2]); This._44 = _To_float(_Other[3][3]);
	}

	template <typename _TFbxMatrix>
	// Copies 16 values from the Fbx container to the provided Reign container.
	inline void _Cast_matrix(
		_Inout_ Reign::Matrix *_This,
		_In_ _TFbxMatrix const *_Other 
		)
	{
		(*_This)._11 = _To_float((*_Other)[0][0]); (*_This)._12 = _To_float((*_Other)[0][1]); (*_This)._13 = _To_float((*_Other)[0][2]); (*_This)._14 = _To_float((*_Other)[0][3]);
		(*_This)._21 = _To_float((*_Other)[1][0]); (*_This)._22 = _To_float((*_Other)[1][1]); (*_This)._23 = _To_float((*_Other)[1][2]); (*_This)._24 = _To_float((*_Other)[1][3]);
		(*_This)._31 = _To_float((*_Other)[2][0]); (*_This)._32 = _To_float((*_Other)[2][1]); (*_This)._33 = _To_float((*_Other)[2][2]); (*_This)._34 = _To_float((*_Other)[2][3]);
		(*_This)._41 = _To_float((*_Other)[3][0]); (*_This)._42 = _To_float((*_Other)[3][1]); (*_This)._43 = _To_float((*_Other)[3][2]); (*_This)._44 = _To_float((*_Other)[3][3]);
	}
};
